﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Medical_Store_Billing.Data_Access_Layer;
using Medical_Store_Billing.Object_Class;
using System.Windows.Forms;

namespace Medical_Store_Billing.Business_Login_Layer
{
    class NhacungcapBLL
    {
        Nhacungcapclass m_Nhacungcapclass = new Nhacungcapclass();
        NhacungcapDAL m_Nhacungcapdal = new NhacungcapDAL();
        public DataTable Laydsnhacungcap()
        {
            return m_Nhacungcapdal.Laydsnhacungcap();
        }
        public DataTable Timncc(String mancc)
        {
            return m_Nhacungcapdal.Timncc(mancc);
        }
        public bool Themncc(string mancc, string tenncc, string dienthoai, string diachi)
        {
            try
            {
                m_Nhacungcapclass = new Nhacungcapclass();

                m_Nhacungcapclass.Mancc = mancc;
                m_Nhacungcapclass.Tenncc = tenncc;
                m_Nhacungcapclass.Dienthoai = dienthoai;
                m_Nhacungcapclass.Diachi = diachi;





                return m_Nhacungcapdal.Themncc(m_Nhacungcapclass);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                return false;
            }
        }
        public bool Suancc(string mancc, string tenncc, string dienthoai, string diachi)
        {
            try
            {
                m_Nhacungcapclass = new Nhacungcapclass();

                m_Nhacungcapclass.Mancc = mancc;
                m_Nhacungcapclass.Tenncc = tenncc;
                m_Nhacungcapclass.Dienthoai = dienthoai;
                m_Nhacungcapclass.Diachi = diachi;




                return m_Nhacungcapdal.Suancc(m_Nhacungcapclass);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
                return false;
            }
        }

    }
}
